<?php $this->load->view("admin/$adminCurrentTemplate/commonHead2");?>
<table width="99%" border="0" cellspacing="1" cellpadding="0"
	class="editFormContainer">
	<form id="editForm" name="editForm" method="post" action="<?=$this->input->server('REQUEST_URI')?>">
	<tr>
		<td class="guid">内容模型：</td>
		<td class="formItem">
			<select size="1" name="channelId" id="channelId" class="single-select">
				<option value='' selected>请选择内容模型</option>
				<?php 
				$str = '';
				if(isset($channelList)){
					foreach ($channelList as $value){
						$str .= "<option value=\"".$value->id."\"";
						if($value->id==$channelId){
							$str .= " selected=\"selected\"";
						}
						$str .=">";
						$str .= $value->title."</option>\n"; 
					}
				}
				echo $str;
				?>
			</select>
		</td>
	</tr>
</table>
<?php $this->load->view("admin/$adminCurrentTemplate/commonFoot2");?>
<script type="text/javascript">
var tvName = '<?php if(isset($tvName)) echo $tvName;?>';
$(function(){
	dg.addBtn('subBtn','提 交',subForm);	
	dg.SetTitle('添加档案');
	dg.reDialogSize(300,106);
	dg.SetPosition('center','center');
	$('#channelId').bind('change',channelChange).change();
})

var channelChange = function(){
	var thisValue = $(this).val();
	if(thisValue.length>0){
		$.ajax({
			type:'GET',
			url:getInfo + '/../addArchives/',
			data:'tvName=channel&channelId=' + thisValue,
			success:function(returnValue){
				if($.trim(returnValue).length>0){
					dg.reDialogSize(778,516);
					dg.SetPosition('center','center');
					gotoLocation(returnValue,'');
				}
			}
		});	
	}
}

var subForm = function(){
	var channelId = $('#channelId').val();
	if(channelId.length==0){
		subMess(208,108,'内容模型错误','<span class="red">对不起，请选择内容模型！</span>',$("#channelId"));
		return false;
	}
}
</script>
